//
//  HomeTableViewController.swift
//  weibo
//
//  Created by chenhongen on 15/10/20.
//  Copyright © 2015年 陈弘根. All rights reserved.
//

import UIKit

class HomeTableViewController: BaseTableViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        
        if !login
        {
            visitorView?.setupVisitorInfo(nil, title: "关注一些人，回这里看看有什么惊喜")
            return
        }
        
        setupNav()
    }
    
    private func setupNav()
    {
        navigationItem.leftBarButtonItem = UIBarButtonItem(imageName: "navigationbar_friendattention", target: self, action: Selector("leftBtnClick"))
        navigationItem.rightBarButtonItem = UIBarButtonItem(imageName: "navigationbar_pop", target: self, action: Selector("rigthBtnClick"))
        
        let btn = TitleButton()
        btn .setTitle("超神五杀怪我咯", forState: UIControlState.Normal)
        btn.addTarget(self, action: Selector("titleBtnClick:"), forControlEvents: UIControlEvents.TouchUpInside)
        navigationItem.titleView = btn
    }
    
    @objc private func leftBtnClick()
    {
        CHGLog("")
    }
    @objc private func rigthBtnClick()
    {
        CHGLog("")
    }
    @objc private func titleBtnClick(titleBtn: TitleButton)
    {
        titleBtn.selected = !titleBtn.selected
        CHGLog("")
    }
}
